The influence of transition metals (Ni and Zn) on the formation, morphology, and thermal stability of long-period stacking ordered (LPSO) phases in Mg97Er2Ni1 and Mg97Er2Zn1 alloys was investigated. In the as-cast state, both alloys consist of α-Mg and LPSO phases. Heat treatment at 540 °C for 20 h dissolves block-like and lamellar LPSO phases into the α-Mg matrix in the Mg97Er2Zn1 alloy, with lamellar LPSO phases reprecipitating during subsequent cooling from 540 °C to 400 °C. Comparative analysis shows that Ni significantly enhances the thermal stability of the LPSO phase compared to Zn. Ni favors the formation of block-shaped LPSO phases, while Zn facilitates lamellar LPSO precipitation within the α-Mg matrix. The LPSO phase in the Mg97Er2Ni1 alloy exhibits an exceptionally high melting temperature of 605 °C, the highest reported for an LPSO phase. Additionally, heat treatment at 500 °C for 100 h preserves the area fraction of the LPSO phase in the Mg97Er2Ni1 alloy, and at 540 °C for 100 h, the LPSO grains grow without phase dissolution or structural transformation of their 18R-type configuration. These findings provide valuable insights into the role of alloying transition metal elements in controlling the stability and morphology of LPSO phases, offering pathways for tailoring the morphology of the LPSO phase in the Mg-based alloys.