@ptrblck instead of using my class MNISTDataset I used torchvision.datasets.MNIST and there’s not accuracy decline when advancing to next epoch. You’re right, so there’s a problem with my class MNISTDataset but I have no clue what could be. Maybe when advancing to next epoch transformations are applied again on the already transformed data? Here is the code of class MNISTDataset:
class MNISTDataset(Dataset):
    def __init__ (self, transform = None):
        xy = np.load('MNIST_train.npy', allow_pickle=True)

        self.len = len(xy)

        self.transform = transform

        x = []
        y = []

        for i in xy:
                x.append(i[0].reshape(28,28))
                
                y.append(i[1])

        x = np.array(x)/255

        y = np.array(y)

        self.x = torch.tensor(x, dtype=torch.float)      

        self.y = torch.tensor(y, dtype=torch.long)

    def __getitem__(self, index):
        if self.transform:
            self.x[index] = self.transform(self.x[index])
        
        return self.x[index], self.y[index]

    def __len__(self):
        return self.len

my_transforms = transforms.Compose([
    transforms.ToPILImage(),
    transforms.RandomCrop((25,25)),
    transforms.Resize((28,28)),
    transforms.RandomRotation(degrees=45, fill=0),
    transforms.RandomVerticalFlip(p=0.1),
    transforms.RandomHorizontalFlip(p=0.5),
    transforms.ToTensor()
    ])

dataset = MNISTDataset(transform = my_transforms)
train_loader = DataLoader(dataset = dataset, batch_size = 1000, shuffle=True)