How do D2R Items you actually acquire these gems? They are primarily found by finishing Elder Rifts in conjunction with Legendary or Rare Crests. These are consumable items that can be purchased via the battle pass or other in-game shop bundles.
The use of a rare Crest gives you a chance to find a 1- or 2-Star Legendary Gem on completion of an Elder Rift, while using a Legendary Crest guarantees that Legendary Gems will be dropped, with a small chance of getting a 5-Star Legendary Gem. The more crests you slot in an Elder Rift, the more gems you'll receive in the end as rewards.
There are, however, a few other ways to acquire Legendary Gems. They can be bought (or traded) through other gamers on the Marketplace by using Platinum and they can also be created by a mixture from Runes along with Platinum. You can craft 1and 2-Star Legendary Gems directly at the Jeweler.
Create a random Legendary Gem in the hopes of obtaining a 5-Star Legendary Gem. Additionally, you can use Fading Ember at the Fading Ember Merchant to purchase one or 2-Star Legendary Gems, with the stock of the merchant fluctuating weekly. Not to mention the Legendary Gems can be found within The game's combat pass.
Due to how scarce, and few 5-Star Legendary Gems are currently on the market, you'll most likely be seeking to locate or upgrade 2 Star Legendary Gems as D2R Ladder Items Buy they come out.