You can create a new piece of weapon/armor (including power armor) or use an existing piece of weapon/armor and then go to a workbench, switch to modify, and then mod that piece into a one star, two star, or three star legendary piece. Legendary cores are a new component in the game that allow you to modify weapons and armor into legendary versions of that weapon and armor. I copied my guide to help people out on the Windows 10 version.
Note: I unlocked this on the Xbox One version of the game which is why I don't have it showing as unlocked here.