Just talking pitch modes…
Assuming you have VNAV armed for takeoff it will engage at 400’ regardless of whether you have an engine failure or not. The engine out acceleration height is entered during pre-flight and may differ from the all engine acceleration entered on the same (TAKEOFF REF PG 2) page. So the aircraft ‘senses’ the engine failure and decides which acceration height to use. The fuel control switch would only come into the equation for e.g. engine fire with no loss of thrust since the engine hasn’t ‘failed’ until the fuel control switch is moved to cutoff. Other failures would be sensed earlier as the engine goes below idle speed. With VNAV engaged the acceleration will start automatically. If you need to delay the acceleration for whatever reason, use speed intervention. e.g. requirement to maintain V2 to V2+15 for a turn.