Warren Buffett could be right about IBM despite its recent woes, but the investment could turn into another huge mistake for the Oracle of Omaha, CNBC's Jim Cramer said Monday.

"If they can pull off this transition [and] become [a] social, mobile, cloud, security and data analytics company, then Warren Buffett's going to be right," Cramer said on CNBC's "Squawk on the Street."