While not explicitly illegal in most countries, gaining access to an account that doesn't belong to you, especially without the owner's permission, is against Facebook's terms and conditions. However, unless you post something while logged in or use the information you find there, you are not likely to be found out. Obviously, this applies when it comes to complete strangers. Things change considerably when it comes to one's own child.