If 'User' is the entity that you have retrieved you can change attributes of this entity. Furthermore, you can set assocations of this entity.
If you want to changes attributes of the entity 'Company', you will first need to retrieve the company with the user. After the retrieve you can change attributes of the entity 'Company'.
See also:
https://docs.mendix.com/refguide/change-object
and