This video will show you a simple way to id the pins of a flyback using a multimeter and two 9 volt batteries.
Please note that the best way is to look at the flyback's datasheet, but if you do not have the part number, or the datasheet is not available, this method can help (however not all flybacks can be tested with this procedure).