The purpose of a Data Transform is to update values on a page, or map one page of data to another.
The purpose of an Access When is to evaluate whether the holder of a Role is authorized to perform an action. I don't see why a transformation/mapping of data would be a component of an authorization check, so I'd challenge why this is your approach.
You are correct in that your Data Transform (and Activity) don't have return values - that's not their job (Functions have return values if you're up for some Java coding).
Assuming there is legitimacy in your approach, a Data Transform can however set a true/false property on a Clipboard Page. Also, classes that pattern inherit from the superclass SingleValue are class-based containers for scalar values.
You could implement a Read-only, Page-structure Data Page - let's say "D_MyAuthorizationCheck" - whose Object type is SingleValue-TrueFalse class, and whose Data Source is a Data Transform on the same class. The Data Transform does whatever calculations it needs to, and sets the true/false outcome to the pyResult property on the Primary page (the Data Page).
Your Access When triggers this Data Transform and accesses its "result" by simply referencing D_MyAuthorizationCheck.pyResult in the expression.
If for whatever reason the logic was so intricate that an Activity was needed, replace the Data Source in the Data Page with the Activity, but follow the same approach of having the Activity set pyResult on the Primary page. Your Access When is abstracted from this implementation detail of whether you use a Data Transform, Activity, or anything else supported by a Data Page.
If the Data Page is used as an authorization check, be sure to set its Scope and Load Management appropriately - likely Thread-scoped / Reload once per interaction. Authorization checks should be re-performed every interaction to ensure authorization is determined based on current data. This means whatever your Data Page runs needs to be highly performant.
Finally, please catch yourself using the pxExecuteAnActivity Function and look for a better design approach. Calling the Activity through a Data Page instead of through a Function is preferable if you must resort to an Activity.