Transformations can be applied to inbound traffic and outbound responses.
Just drag and drop middleware from the right sidebar to the pipeline, edit and save. You can also write your own.