There's another way, you can do that trick where you give the ability with the opposite of your intended effect:
I.e. if you want unit A to transform into unit B, you give it a bear form ability or whatever you want, but instead of how you'd normally do it, make it so that the original unit is set to "alternate" or "transformed" or whatever it is (I don't recall off the top of my head), and set the original to what you want your unit to transform into.
Now, when you want the unit to transform, just add this ability, and then remove it. What will happen when it's removed is that wc3 thinks that the unit is supposed to be the "original" unit according to the ability, which you have set to what's really the alternative unit. Thus the unit instantly transform into the alternative unit.
To get the unit to transform back you need to have a second ability, this time the regular, and what you do is the same thing again. When you want the unit to transform back just give the unit the second ability, and then remove it.
I might post the link for the original post about it, if I find it, but I think it was
@WaterKnight who found this trick long ago.