You could create a loop using the Dataset (or DataLoader) and just use torch.save inside.
I’m not sure, how to access your Google Drive as a file path, but you would most likely know it already.
dataset = MyDataset(..., transform=transform)

for idx, data, target in enumerate(dataset):
    torch.save(data, 'data_drive_path{}'.format(idx))
    torch.save(target, ...

This will run only once (and take some time of course).
After executing this loop, you would write a new Dataset to load these tensors instead of the jpeg images for the training case.