By binary form, do you mean thresholding images(only 0 and 1) rather than using them as grayscale images?
If that’s the case, I don’t think transforms has a function to threshold an image. You can write a custom dataset class which converts the image to binary form
class BinaryMNIST(Dataset):
    def __init__(self):
        self.images , self.labels = ##using datasets.MNIST
    def __getitem__(self, idx):
        image, label = self.images[idx], self.labels[idx]
        image[image < 127] = 0
        image[image >= 127] = 255
        # do the necessary transforms ...
        return image, label