by-transform function

Function to make groupwise transformations