I have a few of those bikes, the 4 pin plug from the stator has two winding outputs, one for the battery charging, horn , winkers etc.
The other yellow wire from the stator is the lighting circuit, goes to ignition switch the to hi/beam/low switch and the globe.
This yellow output always spikes...