USA retiree seeking permit to teach in the EU--Spain

I plan to retire in Spain in a few years and teach English for 5 years before collecting Social Security. Does anyone have experience with this? How involved is the process? Any help would be appreciated.