The New York congressman has won two tough races in two years. He thinks the Democratic Party could learn something.