Transformation approach to constraint handling in optimal control of the heat equation