Approximation of nearly-periodic symplectic maps via structure-preserving neural networks