Sinewave makes a reliable device for this purpose.
https://www.sinewavecycles.com/
There are other sources for this sort of thing too.
There's no reason a person couldn't cobble together a reasonable version of this too. The basics would include a bridge rectifier, filter caps, and a 7805 5V linear regulator. Of course, when the battery is fully charged, the dynamo voltage will rise quite a bit, and some sort of voltage clamp will be needed to protect the 7805.
Steve in Peoria