How do I modify a loaded model's forward pass function?

I loaded a pretrained model. How do I add some print statements to the forward pass method so that I can see the inner layers? So basically assume all I have is an instance of a model class now. Is there any way to modify the methods of an instance of a class for a pytorch model?