Predicting the Performance of Foundation Models via Agreement-on-the-Line