To define natural numbers one can either:
use the Peano axioms in second-order logic;
encode them in set theory as von Neumann ordinals.
The relation between those two definitions of natural numbers is that (2) satisfies (1).
Now, groups are usually defined as sets equipped with operations and axioms. This is akin to (2) above since it is an encoding of groups in set theory.
What would be a definition of groups akin to (1)?
To axiomatize the collection of all groups is far more difficult than to axiomatize the set of all natural numbers. There are, well, a lot of groups, and in particular it makes little sense, foundationally or practically, to try to axiomatize the mere set of all groups. One approach, as mentioned in comments, is to axiomatize the category of groups. You can read a summary of the results of Leroux on this question in ArnaudD's answer here. The axioms are rather technical, but again, this is perhaps to be expected from such an ambitious question.
A related topic which has been somewhat more thoroughly studied, including a nice exposition by Todd Trimble, is the axiomatization of the category of all sets. This is still complicated, though a bit better; you can get close by saying that the category of sets is a category admitting finite products and equalizers, powersets, such that the terminal object detects equality of morphisms, there is a natural numbers object, and the axiom of choice holds. At least, it's reasonable to say that "the objects of such a category are things we call 'sets' ", though without further axioms such a category may not contain all sets.