Can a setup be made that recharges while riding? Yes- while you pedal, that is. You lose more energy by trying to use electricity to make electricty than just conserving the energy in the batteries to propel you forward.
A practical system that can recharge discharged batteries rapidly when you pedal? That's another mattler- not yet, really. But you can put energy back in the batteries when you pedal.
Hybrid cars have several technologies to use as little energy as possible- what they do not do is attempt to recharge the batteries when running on electricity- except for regenerative braking.
No matter what anyone on the internet says about any technology- you can never get more energy out of system than is put in at some point (over time by nature as in fossil fuels, or by recharging in electricity)
You can easily have enough energy to charge batteries for lights.
I took his original post to be referring to powering the bike itself with electricity- that is another matter altogether.
One needs an understanding of electric theory, volts and amps.
This correlates to water plumbing rather well.
Volts is pressure and amps is volume. When you demand a lot of volume pressure might drop.
The HT motor and most little motorbike motors cannot supply enough volts and/or amps to run high powered lights.
Batteries in vehicles generally get a "float" charge which is a subconscious operation, when the vehicle has power to spare. A "float" charge is generally 120% of the battery rating, so 7 volts would charge a 6v battery. Bumping up to 12v requires a relatively complex transformer, and when that bump happens half the amps are gone-- you can't make something from nothing!
The happy time motor dynamo makes "around" 6 volts at 1/2 amp. To run a 55 watt "bright enough" headlight bulb one needs, typically, 12 volts at 4.5 amps. (v x a = watts.)
So the end all run of this discussion is the HT motor doesn't make enough on its own, so one needs to look at external generators. There's a nice long thread somewhere where someone did find a nice 12 volt generator that runs off the chain.
A properly sized (in amps) generator would need a very small or none at all battery for storage. For occasional night riding one could use a smaller amp rated generator (as long as volts were the right amount) to charge a battery but then run at a deficit when the lights were on.
The simplest battery design would be around a 6 volt system, the problem there is finding bulbs that run on 6 volts. Stopped using them in cars in the mid 1950s. Maybe longer on bikes? But the bonus is you can find cool retro stuff on ebay etc.