Analyzing the Power of Chain of Thought through Memorization Capabilities