Here’s a step by step guide.
Step 1: Get Hat Pikachu as a quest reward.
Step 2: Complete the quest.
Step 3: Press claim reward, and run.
Step 4: Wait
Step 5: After the event has finished, catch the Pikachu. It should still have its hat and sunglasses.
I also tried this on Squirtle and it didn’t work. So I’m not 100% sure.