Chevalley groups of type G2 as the group of a trilinear form