Yes. I could have been clearer. The engine drives the generator which produces electricity to charge the battery which uses the stored electricity to power the electric motor which turn the propeller to propel the sub. The engine nees air so, presumably, it will only be run when on the surface or using a 'snorkel'.
Maybe, ,in this design, it is also coupled to a gearbox to propel the sub on the surface where it will spend most of its time in RTN service.😀