The theory of electronic topological transitions