When creating an Express Form Programmatically, how do you define if a field is Required or not, and any custom text/label?

I can’t for the life of me find in the documentation, google result examples, or pretty much anywhere, on how to set an Express Form Field (Attribute/Association) as “Required” and/or set the custom label, or other aspects I get in the Dashboard. But I’m talking about when creating the Form Programmatically.

How does one do that?