Could be one of many possibilities.
Does everything (lights, radio) cut out, or just ignition?
Does it usually start ok, or is that hit and miss too?
If only ignition cuts out when driving, the problem is likely in the 'run' circuit..... ignition switch, wiring, connector at the cowl, Petronix or coil.
I'd check the cowl connector contacts first and resistor wire going to the coil. Make sure connectors are firmly attached to the wires and are free of corrosion.
Check engine ground strap.
Swap out Petronix and coil and see if that helps.
I don't recall which models of Petronix need a full 12v, or if some work with lower voltage (9v) from the resistor wire.
If it's hard to start (no spark), or other accessories turn off when engine cuts out, it's in a different circuit.