Mechanistic Insights into Grokking from the Embedding Layer