It’s basically impossible. Unpowered hub motors drag a lot. Unpowered mid-drives are better because they have clutches or freewheels, but you’re still pedaling a fifty-pound bike. Some ebikes do have regeneration triggered by brake lever switches but it’s pretty rare. Others have a regeneration mode switch. Most just don’t bother.
What you should understand about these bikes is the power delivered by the motor, and the power needed to recharge batteries in a useful time frame, greatly exceeds the continuous power a human would normally exert on the pedals.