You can see the layers via print(model) or have a look at the source code.
You’ll see that, model.fc addresses the last linear layer, so you can just reassign a new layer to this attribute.
Each nn.Linear layer has a weight matrix (and optionally bias), which is defined by the input and output shape of this particular layer. in_features returns the given number of input features for this layer.