transform is run each time you retrieve a sample from the Dataset object.
So for batch size N, it will run N times every iteration (every sample has a different transformation). (not every batch, every epoch, but every sample)