If you don't need the timezone details, then I suggest that you use a standard function replaceString to replace the Z with a no-space blank (so that Z is removed) before the value is then passed to the DateTransform function.
This can all be easily achieved with standard functions, having a UDF only unnecessarily complicates your design. Even if you use UDF, the standard Java methods also uses SimpleDateFormat and therefore cannot accept the literal Z.