The ship would use these generators, connected to the steam turbines driving the ship, to generate electricity. When you think about how many ships were built between 1939-1945, and all the components that went into them, the ability of the Allies to produce equipment is phenomenal.
Right-click and choose "view image" to enlarge.