I agree with @Chong_Toby. I believe that it would be a much better design decision to put transforms as part of the torch.utils.data.DadaLoader()  class. Here’s my experience with this.
It is very common to apply different data augmentation to training and test sets (see Resnet, VGG and etc). Now I have a set of images with some labels and create my own Dataset class. For the sake of modularity and flexibility I would much rather use the torch.utils.data.random_split() class to split my dataset into training and validation than manually split the dataset.
However, this means that I cannot apply different transformations to the split datasets because the transforms are applied to the original combined dataset. However, if they were applied as part of the DataLoader it would fix this issue.