On this page: http://docs.octopusdeploy.com/display/OD/Configuration+files there is a comment that begins: “Using the Substitute Variables in Files feature will change the order that variables are replaced.” and links to a page showing the order that things will run.
However the features are not listed in that order in the step configuration, which makes it look like variables will be substituted before config transforms are applied.
It would be preferable if those features were listed in the order they will be executed, and re-arranged if necessary should the order change due to a given feature being enabled.