A Comprehensive Framework for Analyzing the Convergence of Adam: Bridging the Gap with SGD