This paper studies secret key establishment between two adjacent mobile nodes, which is crucial for securing emerging device-to-device (D2D) communication. As a promising method, cooperative key generation allows two mobile nodes to select some common neighbors as relays and directly extract a secret key from the wireless channels among them. A challenging issue that has been overlooked is that mobile nodes are often self-interested and reluctant to act as relays without adequate reward in return. We propose SYNERGY, a game-theoretical approach for stimulating cooperative key generation. The underlying idea of SYNERGY is to partition a group of mobile nodes into disjoint coalitions such that the nodes in each coalition fully collaborate on cooperative key generation. We formulate the group partitioning as a coalitional game and design centralized and also distributed protocols for obtaining the core solution to the game. The performance of SYNERGY is evaluated by extensive simulations.