Cross-Layer Federated Learning Optimization in MIMO Networks