Predicting transitions in cooperation levels from network connectivity