On the basis that a picture is worth a thousand words, I've edited out two enlarged bits from Shimano's technical documents on this hub. If you look at the first illustration below, the outer cable sits in the "socket" at the back of number 41. Then the inner cable goes forward and runs around under the "pulley" number 40 and is clamped in the inner cable fixing bolt number 43.
That has a line drawn up to the slot in number 40 where the inner cable fixing bolt sits. Rolling off the gear change to give the maximum slack will make it easier to release that. There's a slot under the outer cable socket in number 41, and pulling back the outer cable will allow you to pass the inner through the slot to release plenty of slack. Then you'll be able to angle up and unhook the inner cable fixing bolt from the slot where it sits without undoing the inner from the bolt. Below the illustration is the parts list giving the names and numbers, and more info below that:
Exploded view.jpg
Part list.jpg
The number of links to remove Hal is 2 as you said.
The chain slack isn't critical. It's usually about half an inch up/down movement at the centre, but make sure it's not pulling too hard on the motor's chain idler, so a bit more slack does no harm.
.