Cramer: Buffett could be right about IBM, but...

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."

Cramer made his remarks after Berkshire Hathaway's CEO told CNBC's "Squawk Box" he is sticking with IBM because the stock has not surprised. "It's kind of been doing exactly what I like ever since we started buying it," Buffett said.

Berkshire Hathaway held a 7.79 percent stake, or 76.9 million shares, of IBM since Dec. 31. IBM's stock edged down slightly Monday morning. (Click here to see what the stock is doing now)

Nevertheless, Buffett could end up regretting his IBM investment, Cramer added. "If they can't pull it off, they could be like the Tesco investment that he made," he said.

Berkshire Hathaway first invested in the U.K.-based supermarket in 2006, and last October, Buffett sold his entire stake, calling the investment a "huge mistake." Buffett also admitted in his annual letter to investors he should have sold off the shares earlier. "An attentive investor, I'm embarrassed to report, would have sold Tesco shares earlier. I made a big mistake with this investment by dawdling," he said in the letter.