Generators do not produce electricity when there is no need and ignore the energy from the mechanical shaft. However, the turbines do not stop when the shaft is spinning at full power, instead, they let the steam pass through which means some energy gets lost. To combat this, you can use a {0} attached to the mechanical shaft which will store the mechanical energy as inertia and return it when the power is needed, behaving like batteries.