APOGEE spectroscopic evidence for chemical anomalies in dwarf galaxies: The case of M 54 and Sagittarius