In the simplest terms, you acquire one and then raise it. Legendary monsters in this style of game are generally obtained through events, purchases, or specific breeding combinations rather than a universal recipe, so there is no single formula that applies to all of them.
Check the in-game breeding guide for the particular monster you want, since it lists the exact pairing. Feeding and levelling come after, and that part is straightforward once you have the egg.