That reminds me the problems that my unlucky brother had with its K100.
The bike was acting the same way. When riding, the bike would cut off.
After removing the tank and checking all the connections, the bike would re-start and run for sometimes one week without any problem. Then the bike would start to act again. Having the bike towed at home would sometimes fix the problem
This was a pain to troubleshoot, but eventually he traced the problem to the plug under the gas tank (round plug for the fuel pump). One of the connectors was bad and a good cleaning and re-tightening the 4 female connectors was all it was needed to fix the bike.
Why troubleshooting was hard?
Each time that the bike would cut off, he would remove the gas tank (on the side of the road) to check the connections of the ignition module. when re-installing the tank, the connectors in the round plug would make again a temporary contact until he rode over a bump or simply the vibrations would slightly move the connector.
This should be the first thing that you have to check.
The Hall sensors are also known to fail when getting hot. You should remove the sensors cover, start the bike on the center stand and use a hair dryer to heat up the hall sensors. If they are bad, the bike will stall when they start acting up (It's unlikely that both are going at the same time).
You should test your set of spare sensors using the method explain in the
EFI troubleshooting pageBert