A Guaranteed-Stable Neural Network Approach for Optimal Control of Nonlinear Systems