We actually do. F1 engine's have something called the MGU-H that recovers exhaust gas energy and turns it into electricity that can be used to recharge the hybrid system: https://www.racecar-engineering.com/articles/tech-explained-formula-1-mgu-h/
Technically any turbocharger is doing the same thing except it's hooked up to a compressor for the intake air instead of a generator.