If you are talking about the batteries being charged as you ride similar to a car's engine recharging the battery while running -- you can't.
The alternator on an engine takes 15hp from the engine to keep the battery charged. If you hooked up a generator/alternator large enough to recharge the bike's battery while riding you would have to be pedaling mighty hard to keep up.
It is a mater of mechanical efficiency. There is no free power.