According to the documentation when you do a federation lookup by name the server can specify the memo_type and memo text in the response.
https://www.stellar.org/developers/guides/concepts/federation.html#federation-response
Is it the responsibility of the wallet/client software to handle the federation lookup and parse the response then build the transaction?
Automatically populating the memo server side based on the federation address could be really powerful, but you would have to trust that all clients implement the lookup correctly.