Dimerization of methanimine and its charged species in the atmosphere of Titan and interstellar/cometary ice analogs