Dynamo powered by motorcycle to charge a battery
Perpetual motion machines are impossible no matter how clever you think you are and how complex you can build them.
In your case, the dynamo will impose an additional load to the motorcycle motor and additional consumption from the battery. And, because you lose some energy as heat at any conversion stage, you will in fact get LESS mileage.
Sorry, that's how our universe works. You may as well try some different universe, but I am skeptic - the same laws of thermodynamics that make perpetual motion impossible actually make possible our life as we know it, among other things.
A sane electric or hybrid vehicle actually does use a dynamo process to charge the battery when decelerates or keeps a constant speed downhill. The motor is just switched to dynamo mode. Electric motors are quite easy to be used as generators. That's how the unneeded (at the moment) kinetic energy is harvested for future use. This is called &quot;regenerative braking&quot; (in contrast to frictional braking where the unneeded kinetic energy is simply wasted as heat).