Instability and stratifications of moduli problems in algebraic geometry