Theory of structural transformations in solids