Provide a top-level transformation hook

Resubmission of #222