On the Energy and Communication Efficiency Tradeoffs in Federated and Multi-Task Learning