Legendary enemies can be easily identified with the obvious 'Legendary' prefix and a star beside their name. Legendary opponents almost always drop a piece of legendary armor or weapon when defeated, and it may have one of numerous affixes that boost your character's combat potential.
Open console and enter Since their appearance is random, it's always a good idea to kill and loot a legendary unless you're too weak to fight it.