It should be similar to finding web part property from transformation, so let say if you want to get Title, you can do something like this:
<%@ Import Namespace="CMS.PortalEngine.Web.UI" %>
<%=((CMSAbstractWebPart)this.Parent.Parent.Parent).WebPartTitle %>
The idea is to go up in the page controls hierarchy till you find your webpart. You can generalize it, i.e.:
<%@ Import Namespace="CMS.PortalEngine.Web.UI" %>
<script runat="server">
private static CMSAbstractWebPart GetParentWebpart(System.Web.UI.Control ctrl)
{
if (ctrl is CMSAbstractWebPart) return ctrl as CMSAbstractWebPart;
if (ctrl.Parent == null) return null;
return GetParentWebpart(ctrl.Parent);
}
</script>
%>
...
<%=ValidationHelper.GetString(GetParentWebpart(this)?.GetValue("PropertyName"),"")%>
Since every widget is based on an existing web part (widgets essentially lightweight versions of web parts), this script should give you something back. This above will work in ASCX transformation, you probably need to convert Text/XML to ASCX.
P.S. Macro is a different story, although you can try to access directly your property i.e.{%WebPartTitle%} See if works. I know if it works in web part context, but try it in transformation,it might work there as well. If not - convert to ACSX.