An SDE for Modeling SAM: Theory and Insights