Flashlights: Prospects for constraining the initial mass function around cosmic noon with caustic-crossing events