Learning-Based Communication Optimization for Resource-Constrained Multi-Agent Systems