Lucky Egg is a really useful item that has been around in almost every Pokemon game so far. It is useful if you want to level up a certain Pokemon of yours faster. A Pokemon holding a Lucky Egg will receive bonus EXP points which are usually indicated by the words "gained a boosted xxx EXP points".
You should note that you can only find a Lucky Egg after finishing the game and beating Leon. When you finish the game, head over to Hulbury and go to the Seafood Restaurant. You will be tasked with delivering food to 3 locations.
The first location is simply on the left side of the Seafood Restaurant. It overlooks the gym and is about 4 houses down from the gym.
The next delivery location is in the first house from Hulbury Station. You will get a Large Exp Candy and Nuggets for completion.
Go to the Hulbury Marketplace. You will find a stall with a green roof there, simply talk to the NPC to deliver the final package.
And that's it! Go back to the chef in the Seafood Restaurant and he will give you your Lucky Egg. If you want to level faster and before challenging the League, consider camping and cooking curries for your Pokemon.
Even though you get the Lucky Egg in the post-game, it is still useful if you want to get Pokemon to level up later in the game such as Charmander, which you can only find once you have completed the game.
A Lucky Egg is also useful for leveling up Pokemon you want to bring to your party in post-game events such as the Battle Tower or for Max Raid Battles. Max Raid Battles are the best option to level your weaker Pokemon.