Could you try to pass a custom transformation method instead of a lambda to the transforms?
Alternatively you could also transform the data inside the Dataset in case you are using a custom implementation (or want to use one).