President, PM agree on legal reforms through talks