Here is a code snippet showing the proposed workflow:
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        
        # load the pretrained model here (or pass as argument to __init__)
        pretrained = models....
        
        # extract layers either by assigning them to new attributes
        self.features = pretrained.features
        # or by using nn.Sequential, if possible
        self.features = nn.Sequential(pretrained.children()[:3])
        
        # add your custom layers here
        self.classifier = ...
        
        
    def forward(self, x):
        # define the new forward using the pretrained modules, your custom layers
        # and the fucntional API
        x = self.features(x)
        x = F.relu(x)
        x = self.classifier(x)
        return x

In this code snippet you can see that I’m reusing some pretrained layers and could potentially wrap them even in an nn.Sequential block, while the forward method is defined explicitly.
Let me know, if you have more questions or get stuck.