Catalysis with microporous aluminophosphates and silicoaluminophosphates containing transition metals