Ciao
You can upgrade UAG before the Connection Server but depend on what is the UAG version that you want to install
This is the link of server Interoperability from UAG and Connection:
Product Interoperability Matrix (vmware.com)
Connection Server version 7.13 is compatible whit all UAG versions (except 2012)