Good luck with your project but as an avid cyclist I pray to God that I never reach a point that I can appreciate, or even comprehend a bike that goes absolutely nowhere. I absolutely despise those lame Peleton commercials!
How can I use a PWM to control the field current of an alternator?
Don't forget to include a bypass/freewheel diode to prevent the high voltage on the collector of the power transistor. Better to use a DC-DC converter. Lower ripple current on input and output. Alternatively, break the feedback to the built-in regulator and use that to control the field current.