Diesel engines on large ships typically work as diesel-electrics, the way railroad locomotives do. For example, Celebrity Solstice[1] uses diesel generators and azimuth thrust pods which contain electric motors. Celebrity Millennium[2] uses gas turbine generators and azimuth thrust pods. The electricity is also used for the rest of the electrical needs on the ship. The cruise industry is adopting LNG fuel, and hybrid power plants, gradually.
[1] https://en.wikipedia.org/wiki/Celebrity_Solstice [2] https://en.wikipedia.org/wiki/Celebrity_Millennium