You should be able to do this using torchvision.transforms.RandomAffine. You can set the degrees to 0 and set the translate parameter to what you need.
https://pytorch.org/vision/stable/transforms.html#torchvision.transforms.RandomAffine 52
# An example. Note that translate refers to the fraction of the length of that dimension to translate by.
shift = transforms.RandomAffine(degrees = 0, translate = (0.2, 0.2))