I lurk on a lot of MC forums and this comes up every now and then. The experts say you should exercise the kill switch which I try to do every time I ride. In fact, here is a quote from a Goldwing forum from yesterday by the resident expert in answer to a bike that just shuts off.

"If tapping on the top of the kill switch makes it stutter or stall, cycle the switch in both directions about 50 times. Lack of use usually allows oxidation to build up on its contacts and flipping it off-on-off a bunch will wipe the contacts clean again.

If tapping on the switch has no affect, then it's something else and will need more troubleshooting."