My Apologies, i initially thought you were trying to just copy and paste inline control logic into a transformation. You may be able to use the CMS.MacroEngine.MacroContext.MacroResolver (may be slightly off on the name) to resolve the macro, and see if that works.
Otherwise if you are trying to add a Widget/webpart into a transformation, what you want to do is place an inline control in your transformation (the actual ascx) and configure it, or use the OnInit to set values.
<cms:CMSTextBox ID="MyControl" runat="server" />
protected override void OnInit(EventArgs e)
MyControl.Text = "";