Weak KAM theory for a weakly coupled system of Hamilton–Jacobi equations