Second-order guarantees in centralized, federated and decentralized nonconvex optimization