Choose MCU with long life cycle
look at the spread of family of products. STM32 has about 800 or more MCU options to choose for 32 bit ARM platform. It helps you to have multiple MCUs with same footprint options as well as easy upgrading of ROM and RAM memory options within the same family of MCUs.
How old are previous MCUs from the same vendor? how many other products are there which have guaranteed long term availability or available form very long time? 
How do they manage LTB (last time Buy notices, how many years or months they will give the guarantee of supply, in case it happens)
From declaration of EOL (End of Life) and LTB, one will be also able to find alternate MCUs with same foot print (in order to keep zero change in hardware) and ideally almost same eco system for maintaining and compiling code. If one is capable of storing the products in recommended storage conditions, one has to act now.
Look for obvious declarations.. a few examples below from ST, Renesas etc.
Choosing the MCUs with flexibility in RAM and ROM (same package can offer from 256 KB to 1 MBytes of internal memory). When in case the product runs out of stock, there will be chances of getting MCUs with may be higher memory options from other second sources
Depending on the business we have with MCU vendors, there will be early flags which can be learnt from the vendors. It is not like a quarterly report of companies which has to be kept very secret until declaration. 
Stating requirement directly to the vendors also helps in filtering out most obvious fault choices
Keep the programs still modular and not specific to one MCUs. Migrating MCUs is still a pain unless drivers, applications, middle wares are well coded structurally.
Ask Ask Ask. vendors, suppliers, second level suppliers, Field application Engineers and also team from plants directly
prefer the vendors who have atleast two or three fabrication plants in different locations (think about war, earthquake or even just building collapse for some reason)
History of sourcing ability, debug support, support for internal release and qualification of products, help and support channels should also be considered.  
Voluntarily subscribe to notification on product status change (business units will automatically get information from vendors, really in formal ways, but why not keep a voluntary check too? also about being in touch with FAEs (Field Application Engineer, or also sales representatives) once in a year to discuss about the products life term).  
Think in advance about your product line up for coming years down the line. Which feature may be needed ( Ex.: Security, hardware encryption etc) which may help in not dropping the chosen MCU because of product requirement reason and not because MCU is now obsolete.  


Below are just examples where i could easily find about longevity promises (ofcourse with *) i also see this as an hint on vendors i would prefer. Why would one choose from the vendor who has no such programs unless there is a huge record of not making parts obsolete? isn't it?



NXP  

Link here




Renesas

Link here
  



Si Labs

Link here




STM32 Microcontrollers  

Link here


Microchip (covers ATMEL also now)
My answer will be incomplete without mentioning Microchip.