You could use e.g. sklearn.model_selection.StratifiedShuffleSplit 2 (or any other suitable splitting function) to create the split indices.
Once you have the indices, you could pass your dataset together with the split indices to a Subset and pass it then to a DataLoader.