The transform method returns three value and you should use x, y and cat_xy in __getitem__.
And if you need original image, mask and cat_img you can return 3 value in __getitem__.
Then you can pass your custom dataset to a DataLoader.