Unfortunately, you can't get hardhats in My LEGO Network anymore. Since the LEGO City games are no longer around, and earning hardhats required playing one of those games, that avenue is closed off.