Boosting thermoelectric efficiency using time-dependent control