Palantir has been a major beneficiary of artificial intelligence (AI) spending, but the stock's rally could start to wane.