First-principles nonequilibrium Green's-function approach to transient photoabsorption: application to atoms