Discovering Invariant Neighborhood Patterns for Heterophilic Graphs