MAGIC: Generating Self-Correction Guideline for In-Context Text-to-SQL