An expert in mental illness, especially with reference to legal ramifications.
A psychiatrist or psychologist.