When you trade Pokemon, there is a small 5% chance that they will turn into a Lucky Pokemon. However, trading Pokemon that are three years or older have a 20% chance of turning lucky. A Lucky Pokemon's stats are rerolled with a minimum of 12 IVs across all stats. Furthermore, Lucky Pokemon require less Stardust to CP boost.