You can simply return two tensors in the forward method of your model.
E.g. using your model:
class NN(nn.Module):
    def __init__(self, n_feature, n_hidden, n_output):
        super(NN, self).__init__()
        self.hidden = nn.Linear(n_feature, n_hidden)
        self.predict = nn.Linear(n_hidden, n_output)
        #probably here i can define the outputs

    def forward(self, x):
        x1 = torch.sigmoid(self.hidden(x))     
        x2 = self.predict(x1)     
       
        return x1, x2

would return now the intermediate activation as well as the last output.