Guaranteeing Conservation of Integrals with Projection in Physics-Informed Neural Networks