Taskmasters were officials appointed to impose burdens and forced labor. In Egypt they were placed over the Israelites to oppress them, subdue their spirit, and prevent independence or rebellion.
The taskmasters supervised Israel’s labor under Pharaoh and enforced the burdens imposed on the people during their period of slavery.
The oppression is associated with the expulsion of the Hyksos and the establishment of a new Egyptian dynasty that knew nothing of Joseph and his people.