The collate function is defined in the DataLoader and usually responsible to create the actual batch using the returned samples from the Dataset.__getitem__. The __getitem__ would load, transform, and return a single samples while the collate_fn would then optionally pad the samples and stack them to a single batch.
Let me know if this fits your understanding or if more details are needed.
If you want to load a single sample and transform it multiple times, you could add these operations into the __getitem__ and return all samples at once. This would of course increase your actual batch size since by default a single sample is expected in the collate_fn. Let me know if I misunderstand your use case or question.