Necessary and Sufficient Conditions for the Transitivity of Majority Decision with Generalized Preferences