Hi,
If I have understood your question properly, You can just return output and latent_vector and do the other things as you have mentioned. But if you do not want to return the output not a tuple, I think it is good to add a attribute to your Model class and update it every time through forward function and you can obtain its value just by calling model.self.latent_vector.
class Model:
  def __init__(self):
    self.latent_vector = None

  def forward(self, x):
    self.latent_vector = x
    output = x*2
    return output

model(2)  # prints 4
model.latent_vector  # prints 2

Good luck
Nik