I already have this. I use a SON hub and a B&M Luxos U. The hub creates max 6W. If you ride with lights off then it’s all available for USB but if lights on only get USB power at higher speeds. I can usually finish the day with a charged phone.
So I’d take your idea and tweak it. If Anker made a bike light which took the hub output , 6V AC I think, and generated light but any unused excess power charged an internal cell and it had USB output then the light can be recharged and be a power bank.