On a transmission problem for equation and dynamic boundary condition of Cahn–Hilliard type with nonsmooth potentials