Geometric criteria for phase transitions: The Ising model with nearest and next-nearest neighbor interactions