An abstract transmission problem in a thin layer, I: Sharp estimates