Text this: Enhancing cooperation in dynamic networks through reinforcement-learning-based rewiring strategies