How to read an intermediate layer of a pretrained network

I have a pretrained network whose layers have similar names like the following code. Is there any way to extract the features from the intermediate layer?

class Net(nn.Module):
   def __init__(self):
      super(Net, self).__init__()
      self.conv1 = nn.Conv2d(...)
      self.conv2 = nn.Conv2d(....)
      self.conv3 = nn.Conv2d(....)

    def forward(self, x1):
      x1 = self.conv1(x1)
      x1 = self.conv2(x1)  <-------------------- the variable that I want to visualize
      x1 = self.conv3(x1)
      return x1

You could use forward hooks as described in this post or rename the output activation and return it in the forward method. The latter approach might be useful in case you would like to always return this activation, while the former one is more ad hoc.