The Local Group as a time machine: studying the high-redshift Universe with nearby galaxies