Can language models learn analogical reasoning? Investigating training objectives and comparisons to human performance