If you have ae = Autoencoder() just using ae.encoder(x) is fine. Also enc = ae.encoder will give you the encoder module and it’ll work on it’s own, too (you can even save and load etc.).
Best regards
Thomas