How does a generator work in a geothermal power plant?