Automated Task-Time Interventions to Improve Teamwork using Imitation Learning