Voltage Spikes in AC voltage Controller
Okay, assuming your question is about why the spikes are there and how to get rid it off...

If zero voltage switching is not used to synchronize the MOSFET switching with zero crossing of the rectified AC, switching occurs at random interval causing very high dV/dT and it generates tons of harmonics which adds up to the fundamental. Even if zvs is used, the MOSFET will have to cut off at non zero interval of the AC cycle since it follows the pwm signal from the controller. However, probably the severity of the harmonics could be reduced with zvs.

The only way to reduce this spikes is to employ snubber caps together with choke filters. Put the cap across the transformer primary just after a choke input filter. Caps may need resistor in series with them to prevent them from overheating.