Hi! I am just wondering. What if, for example, Heat Rotom holds a Firium Z then turns into Wash Rotom?
Nothing will happen. Rotom will change its form.
Any Pokemon holding a Z-Crystal that loses the move it uses/changes to a form incompatible will still hold the Z-Crystal, it just cannot use it. Source: Experience
Rotom will still have the Z-Crystal but will be unable to use it unless it knows a compatible move for said Z-Crystal. If your Rotom knows Sunny Day or Will-O-Wisp then it will be able to use the Firium Z.