Neither the softmax method nor the model “knows” anything about the label.
You, as the researcher, create the dataset and create the input-output mapping, which the model tries to learn. This would also mean that you are free to remap any labels, as long as it’s consistent for all samples in the dataset.
The predictions of the model would also give you the logits (or probabilities assuming you apply softmax on them), which can then be mapped to the class index via torch.argmax. The interpretation of this class index to a class name also defined by the input-output mapping.