If you're doing this to save money, buying a new bike from last season will save you more. If you're just wanting to make minor changes like a certain type of crankset or dropper, buy whatever gets as close to your preferred specs and then upgrade. Remember that you can always sell the "new takeoff" parts that you replace.
I did this with a road bike once and it ended up being a giant pain. I got a pretty good deal on an older frames et and built it up, but I still ended up buying a new bike a couple years later.
I bought my frame on ebay, but it took a few weeks off watching listings to get what I was looking for.