Yup, you got to do that, The Battery, if it cannot keep juice up, if the power falls below 9 volts, then it stop on you. The TCI (brain) needs over 9 volts to keep the bike firing.
theory goes
12 volt battery, to starter, bike starts up, Headlight turns on.
Bike starts, Stator is creating energy (AC volts)
Stator to rectifier, energy turns to DC Volts, about 12.1-.5 about.
Rev engine over 2k RPMs, kicks DC Volts to 13.1 or so
Brake lights on, or HI beam headlight uses more juice, Regulator sense the power draw
Voltage reg kicks the magnet on, so the stator creats more energy to keep the power at 12+ volts
Generically (my opinion) all of our bikes have a weak spot, the wires from the stator, to the first plug in. generically (not specifically yours) are toast on the back bottom of the engine, where the duck out, and go up the back side. They are crispy, you will hear them crackle, and if you ohm them out, they will get worse as you test them. (press on them) (comes from being 30+ years old) Fix, follow drewpies re-wire.