Accurate and robust relative position information is fundamental for enabling self-organized cooperation in multi-agent systems, particularly for unmanned aerial vehicle (UAV) swarms in the emerging low-altitude economy. However, achieving high-performance relative localization remains challenging, primarily due to the critical issues of reference frame coordination which establishes and maintains a reference frame consensus across the network. In this paper, we establish an optimization framework that bridges performance bounds and algorithm designs, enabling the derivation of optimization structures for centralized relative localization, which facilitates an alternating direction optimization algorithm for subnetwork-oriented scenarios. We then propose a distributed relative localization scheme that integrates an orientation-aware and dynamics-aware state merging mechanism for coordination across different inertial reference frames. Furthermore, we develop a spatial-temporal cooperation approach through real-time adaptive frame alignment and multi-source information fusion, effectively suppressing error accumulation. Simulation and real-world experiments demonstrate that the proposed algorithms achieve superior accuracy and robustness, providing an effective solution for relative localization and enabling key applications in the low-altitude economy.