Algebraic diagrammatic construction formalism with three-body interactions