As part of your disclosures, lenders that plan to sell your loan will usually be required to disclose this fact, so you can deal with a lender that keeps their loans in house. The last house I bought the company disclosed that they might sell the loan, but they remain the servicer on the loan, so I don't even know who owns it.
Since then I've bought 2 houses, and both mortgage companies I've worked with had that clause.
Is it actually possible to find someone who won't? Or is it just a false sense of choice like the ability to "choose an ISP that says they won't sell your information"?
Some credit unions may keep the mortgage in-house, but afaik it's mostly private banks working with HNWIs that will do so 100%. Those mortgages are often very large or non-standard (like 100% financing interest only or a combo mortgage/heloc).
Some small community banks maybe? Some banks keep at least a portion of their loans in house. In some cases they may still have that clause in case they decide to sell it later, even if they plan to keep it in house.