Enchant creature
Enchanted creature has "{T}: Create X 1/1 red Elemental creature tokens with haste, where X is this creature's power. Exile them at the beginning of the next end step."
If the ability is activated after the current turn's End step has begun, the tokens won't be exiled until the next turn's End step.
The enchanted creature's power is checked at the time the ability resolves. If the enchanted creature has left the battlefield by then, its last known information is used.
The tokens will be exiled in the End step even if Elemental Mastery or the enchanted creature has left the battlefield by then.