transforms.Compose currently only handles transformations with a single argument as shown in these lines of code 151.
You would have to apply your custom transformation separately or maybe wrap it in a tuple and unpack it inside your transformation.