If you look at the documentation for HttpResponse, you'll see that there are two methods that should interest you:
getHeaderKeys() gives you a list of strings. If a "location" header is given to you in the response, then it'll be one of the entries in that list. After confirming its existence, you could then call
@RestResource class has access to the response that Salesforce will return to the caller of your apex REST class via
RestContext.response, which is an instance of the
RestResponse class. It has a public
headers variable which is a
Map<String, String> which you can add things to (such as your "location" header from the other callout).