When the his happens, does the bike suddenly stop as if someone pulled an electrical plug? Does the bike lose all electrical power, no lights, no spark, etc, or does it bog down and shudder, then stop?
If the motor quits during a ride, and won’t spark back to life, then I suspect your ignition is at fault (possibly bad condensers). The heat created from riding can cause electrical components to fail after some amount of time. That’s a guess.
Does the bike restart after a while of resting without needing a battery charge or jump?