The goal of being a long-term investor is obviously to buy stocks you plan to hold for years into the future. But there are different levels of "forever stocks." While I hope to hold every stock I buy for the long haul, the reality is that I (and most other long-term investors) sell stocks regularly, and for a variety of reasons. But there are some that I couldn't see myself ever getting rid of.

Here are two stocks in particular, both of which are among the largest positions in my portfolio, that can be great ways to build generational wealth for decades to come.

If I could only own one stock...

I've said before that if I were only allowed to buy one stock, it would be Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%), and it isn't even close.

For one thing, Berkshire is designed to make money no matter what the economy or stock market is doing. It owns more than 60 subsidiary businesses, most of which are recession-resistant and that generate billions in reliable cash flow that can then be invested in acquisitions or other opportunities that arise. In addition, Berkshire has a portfolio of stocks that is worth more than $300 billion and has dozens of top-notch businesses in it, including large stakes in Apple (AAPL -0.35%), Bank of America (BAC -0.21%), Chevron (CVX 0.37%), and more.

In fact, Berkshire is possibly the best-positioned company in the U.S. to benefit from tough times. It has $129 billion in cash and short-term investments on its balance sheet, which gives it tremendous financial flexibility to take advantage of bargain investment opportunities.

My favorite dividend stock in the market

Realty Income (O -0.17%) is the first real estate stock I ever bought and is my favorite overall dividend stock in the market. Simply put, it offers a rare combination of growth potential, income, and low volatility, as well as a stellar track record of delivering for long-term investors.

If you aren't familiar, Realty Income is a real estate investment trust, or REIT, that owns about 11,700 single-tenant properties, most of which are occupied by retail businesses. But these aren't just any retailers. Realty Income specifically focuses on tenants that are recession-resistant and not easily disrupted by e-commerce competition. Just to name a few, Walgreens (WBA 0.57%), FedEx (FDX 0.12%), and Dollar General (DG -0.41%) are among the largest tenants in the portfolio.

Since listing on the NYSE in 1994, Realty Income has generated a 14.6% annualized return for investors, which means that a $10,000 investment at that time would have grown to more than $520,000 today. The stock has a 4.9% dividend yield and has increased the payout for 102 consecutive quarters, with no reason to believe the streak will end anytime soon.

No guarantee I will hold these forever, but...

It's important to point out that there's no such thing as a guaranteed "forever stock." If these businesses continue on in their current form, I can't see any scenario where I'd sell, but there's no guarantee that will happen. Just to name some hypothetical situations, Warren Buffett is 92 years old, and there's no guarantee his successor will have the same investing style. Realty Income could potentially be acquired or taken private at some point.

To be clear, I don't think either of these things are likely to happen. But they could. The point is that although I consider these my top two stocks I'm likely to own forever, it is still important to keep track of any developments with the businesses you invest in.