The Heterogeneous Impact of the Energy Transition