Compositional Learning for Modular Multi-Agent Self-Organizing Networks