The party's popularity is prompting debate over how to balance an anti-establishment identity with the need to appear as a credible partner to allies.