WASHINGTON—President-elect Donald Trump is considering several retired military generals as possible picks to be secretary of defense, people knowledgeable about the transition process said.

Retired Marine Gen. James Mattis, a former war commander who has long voiced concerns about the security threat posed by Iran, is among those being considered. Gen. Mattis is expected to visit with Mr. Trump in New Jersey, transition officials said Friday.

Gen....