You could access the underlying .data and .target attributes:
import torchvision.transforms.functional as TF

dataset = datasets.MNIST(root='./data',
                         transform=transforms.ToTensor())
data = dataset.data
print(data.shape) # torch.Size([60000, 28, 28])
img = TF.to_pil_image(data[0])