The YAML method employs pulling raw data on your character's face from the save, then using a mathematical calculation to get the closest face code in ME2 (not ME3). You can see a fantastic explanation of it here:
I will not personally go through the YAML method that Bioware has suggested, since instructions have already been provided that are more succinct than I could produce. Janus Propsero on the Bioware Social forums has provided an excellent guide for generating a face code:
Why does this method not always return the exact Shep you had? Mass Effect Tools and the code generation software used in this method are not erroneous at all. They're marvellous and do everything right from what I can tell. I envy the developer's ability.
From what I can tell, based on looking at the math, the reason a face code Shep won't replicate your imported Shep is because a face code is imprecise. A face code sets the positions (or ticks) in ME2's character creator. Slider positions in ME1 generated values often between slider positions in ME2. I could be wrong, but that's the impression I have been given looking at the data.
Nevertheless, this is a great method and the way I see it, your mileage varies as far as you go with it. There is no reason why you couldn't use this method, then use the Gibbed method (see the Face Effect tutorial below) to deal with colours and some minor positions.