When the lights and dash go out at the same time, the common power circuit is checked first. A weak voltage without load can look acceptable but drop sharply when cranking.
What to measure
With the bike safely stopped, inspect the terminals, the earth, the main fuse and its holder. Check the tightness and for signs of heat; oxidation and looseness can cause another failure on the move.
Measure the battery after charging and resting, while cranking and with the engine running. Owners have described 12.4–13 V at rest and a big drop under load, but an exact conclusion takes the battery and the test into account. The dash reading is not the same as a measurement at the terminals.
Telling the causes apart
If power was restored after cleaning and correct tightening, check the result under load. If the battery doesn't hold a charge, it is tested; if there's no normal charging, the alternator, regulator and connections are. A drop at certain revs doesn't by itself prove a weak regulator across the whole model.
Choose a replacement by size, polarity, mounting and specifications; the manuals give 12 V, 10 Ah. Cardboard under a smaller battery, from someone else's experience, is not a reliable way to secure it.
After DIY electrics, separately check the parked current draw and the power wiring. Repeated cutting out on the move requires fixing the cause before a long trip, even if a jump start helped for now.