Recently, Antoniadis, Konitopoulos and Savvidy have introduced in Refs. [1-4] a procedure to construct background-free gauge invariants, using non-abelian gauge potentials described by forms of higher degree. Their construction is particularly useful because it can be used in both, odd- and even-dimensional spacetimes. Using their technique, we generalize the Chern-Weil theorem and construct a gauge-invariant, (2n + 2)-dimensional transgression form, and study its relationship with the generalized Chern-Simons forms introduced in Refs. [1,2]. Using the methods for FDA manipulation and decomposition in 1-forms developed in Ref. [5] and applied in Refs. [6] and [7], we construct a four-dimensional Chern-Simons gravity action, which is off-shell gauge invariant under the Maxwell algebra. (C) 2015 The Authors. Published by Elsevier B.V.