Ternary Hom–Nambu–Lie algebras induced by Hom–Lie algebras