; and (ii) in cases of ambiguity, an immigration judge shall use the rule of lenity in choosing from among the laws of the relevant circuits. (C) Record If a detainee is transferred, the Secretary or law enforcement agent shall prepare a record of— (i) the reasons necessitating the transfer; and (ii) actions taken to ameliorate any adverse effect on the legal rights of the detainee. (D) Investigation If a detainee makes an allegation of retaliation, such allegation shall be investigated by an independent entity. (g) Training (1) In general The Secretary, in consultation with the Civil Rights and Civil Liberties Officer, shall provide all officers of the Department, other Federal agencies, and all State and local officers involved in immigration-related enforcement activities with periodic training regarding— (A) immigration law; (B) civil rights law; (C) medical and mental health needs and treatment; (D) due process protections; (E) humanitarian guidelines under current law, including— (i) the right of access to immigration legal counsel; and (ii) the appropriate treatment of vulnerable populations during immigration-related enforcement activities; and (F) racial profiling and implicit bias. (2) Implicit bias defined In this subsection, the term implicit bias means— (A) bias in judgment or behavior that results from subtle cognitive processes, including implicit attitudes and implicit stereotypes, that often operate at a level below conscious awareness and without intentional control