You could try to apply a softmax as the last activation function in your model and use nn.MSELoss directly on these outputs and the one-hot encoded targets.
Alternatively, you could also use a single output unit, which could be used to predict the class “index” as a floating point number and calculate the loss using the targets containing class indices.
However, note that nn.MSELoss is not the usual loss function you would use for a classification use case.