This spell, Phantasmal Transformation, is "cast" by any NPC onto which an enchanter has cast the "Phantasmal Opponent" AA.
The AA gives the enchanter a single "swarm pet" whose model is the same as the NPC that was targetted when the AA was cast (a clone pet).
The side effect of this is that throughout the fight, while the clone pet is alive and attacking the NPC, the NPC (not the pet) repeatedly casts Phantasmal Transformation.
So one reason you may see an NPC casting this, can be due to an enchanter player nearby having copied the NPC into a temporary swarm pet.
Rondor