Meta stock had its best month in almost four years as investors cheer the social media giant's recent momentum in artificial intelligence.