If your bike cuts out in the manner you describe it's electrical. Sidestand switch or tip over or bank angle switch or some other major connection. Use contact cleaner and emery paper to clean up contacts on these switches and test them. While you're doing this I'd clean the battery terminals + the wires connecting to it and also pull and inspect fuses. Don't go by visual inspection alone, terminals or connectors can look OK, but have a film of corrosion on them that blocks proper contact.