Value function, relaxation, and transversality conditions in infinite horizon optimal control