You can apply tranformations to the data loader class.
data_transform = transforms.Compose([
        transforms.RandomSizedCrop(224),
        transforms.RandomHorizontalFlip(),
        transforms.ToTensor(),
        transforms.Normalize(mean=[0.485, 0.456, 0.406],
                             std=[0.229, 0.224, 0.225])])

data_loader = datasets.ImageFolder(root='data/train',
                                           transform=data_transform)

train_loader = torch.utils.data.DataLoader(data_loader,
                                             batch_size=4, shuffle=True,
                                             num_workers=4)

Additonal resources on writing custom data loader class can be found here: http://pytorch.org/tutorials/beginner/data_loading_tutorial.html# 279