Transforms on subset

One approach would be to write a simple custom Dataset, which just applies your transformation to the internal subset as described here.