Theory of strain phase separation and strain spinodal: Applications to ferroelastic and ferroelectric systems