Identifying past social-ecological thresholds to understand long-term temporal dynamics in Spain