I think you can do it, lets say you are using a resnet50
model = models.resnet50(pretrained=True)
inp = model.fc.in_features
bottle_neck = nn.Linear(inp, 256)

classifier1 = nn.Linear(256, 10)
classifier2 = nn.Linear(256, 10)

class Flatten(nn.Module):
    def forward(self, x):
       x = x.view(x.size(0), -1)
       return x

feature_extractor = nn.Sequential(*(list(model.children())[:-1]), Flatten(), bottle_neck).to(device)


Now, In the training loop pass the same features to both the classifiers, compute the loss, sum them(may be balance with a hyper parameter) and backpropagate.