Investigating Literary Motifs in Ancient and Medieval Novels with Large Language Models